﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using pswb.Forms;
using pswb.Forms.ProcessEdit;
using pswb.Forms.FlowDesigner;
using WeifenLuo.WinFormsUI.Docking;

namespace pswb
{
    public partial class frmMain : DockContent
    {
        public frmMain()
        {
            this.Hide();
            Thread splashthread = new Thread(new ThreadStart(SplashScreen.ShowSplashScreen));
            splashthread.IsBackground = true;
            splashthread.Start();
            InitializeComponent();
        }

        private void lnkFlows_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmFlowDesigner flowDesigner = new frmFlowDesigner();
            flowDesigner.Show();
        }

        private void lnkGroups_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmGroupEditor groupEditor = new frmGroupEditor();
            groupEditor.Show();
        }

        private void lnkUsers_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmUserEditor userEditor = new frmUserEditor();
            userEditor.Show();
        }

        private void lnkProcesses_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmProcessEditor processEditor = new frmProcessEditor();
            processEditor.Show();
        }

        private void lnkSettings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmSettings settings = new frmSettings();
            settings.Show();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            SplashScreen.UdpateStatusText("Loading Modules..");
            //Thread.Sleep(2000);
            SplashScreen.UdpateStatusText("Items Loaded..");
            //Thread.Sleep(500);

            this.Show();
            SplashScreen.CloseSplashScreen();
            this.Activate();
        }
    }
}
